Today's graphics processing systems can process and present complex three-dimensional (3D) objects and scenes in what seems like real-time to a system user. The demand for computer-generated animation in television and movies, virtual reality devices, and immersive computer games has accelerated graphics application development. Consequently, the high resolution and quality of many modern graphics applications require high performance graphics processing systems and components. Graphics design engineers are constantly looking for new procedures that can accelerate graphics processing while also reducing the load on a graphics processing system.
Graphics designer engineers attempt to increase processing speed by determining whether an object or a portion thereof is not an important feature in an image. For example, graphics processing systems utilize z and stencil (also referred to as depth and stencil or sometimes collectively as “depth”) processing techniques to determine if an object is occluded or not visible in a scene. If the object or pixel is determined to be occluded, further processing may be avoided, which helps to speed up processing time. That is, depth operations may be performed before performing other pixel processing operations.
However, even if a depth operation is performed early in the processing timeline, other tests, such as alpha-tests etc., may still delete a pixel that passed the early depth operation. In such cases, an early depth operation may not be enabled if the rendering state is such that using the early depth operation could lead to incorrect results. For example, suppose that a pixel sample satisfies an early depth test and a new z-value replaces an old z-value associated with the pixel sample. If the pixel sample is later deleted, after an alpha test for example, then the z-value that was replaced due to the early depth operation should not have been replaced. Thus, it is possible that subsequent graphics processing operations may use a wrong z-value, which may result in erroneous image rendering. In cases where an early depth test may lead to such circumstances, traditional depth testing may be used.
Traditional depth testing typically occurs during a later stage of a pixel processing pipeline. For example, a traditional depth test is implemented after shader processing operations. Moreover, the traditional depth test may result in wasted processing time and adversely impact bandwidth. For example, a number of pixels may still be discarded after having been textured, alpha-tested/blended, etc., which results in wasted processing operations, unnecessary bandwidth usage, and a slower rendering time. Additionally, valuable processing bandwidth may have been imprudently provisioned to pixels which are ultimately discarded as a result of the traditional depth test.